<?php

/**
 * Created with Sublime
 * Author: yinni
 * Date: 2017/12/02 18:27
 */
namespace App\Http\Controllers\Admin\Analysis;

use Log;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Services\Admin\AnalysisService;
use App\Http\Requests\Admin\UserRequest;
use \App\Http\Controllers\Admin\BaseController;

/**
 * 统计分析
 * Class AnalysisController
 * @package App\Http\Controllers\Admin\Analysis 
 */
class AnalysisController extends BaseController
{
    protected $service;
	public function __construct(AnalysisService $service)
    {
        parent::__construct();
        $this->service = $service;
    }

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $result = $this->service->index();
        return request()->ajax() ? $result : view('themes.admin.analysis.index')->with($result);
    }    
}